package com.example.group.network.express_plus_app.ui.mine;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;

import com.example.group.network.express_plus_app.data.LoginDataSource;
import com.example.group.network.express_plus_app.data.LoginRepository;
import com.example.group.network.express_plus_app.ui.login.LoginViewModel;

/**
 * @author 夏宁
 * @email 1941512303@qq.com
 * @date 2021/3/25 0:22
 */
public class MineViewModelFactory implements ViewModelProvider.Factory{
    Context context;

    public MineViewModelFactory(Context context) {
        this.context = context;
    }

    @NonNull
    @Override
    public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
        if (modelClass.isAssignableFrom(MineViewModel.class)) {
            return (T) new MineViewModel(context);
        } else {
            throw new IllegalArgumentException("Unknown ViewModel class");
        }

    }
}
